Make the event_window large enough to cover the full height of the
authorMatthias Clasen <mclasen@redhat.com>
Mon, 2 Oct 2006 03:50:38 +0000 (03:50 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 2 Oct 2006 03:50:38 +0000 (03:50 +0000)
2006-10-01  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkexpander.c (gtk_expander_realize)
(gtk_expander_size_allocate): Make the event_window large
enough to cover the full height of the label_widget.  (#358351,
Scott Horowitz)

ChangeLog
gtk/gtkexpander.c

index e476ffcf3b2b676f3657a269d2d2a4ef6ef0f7df..73bcb2ec9826b2b4c1811531298993763c753f8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize) 
+       (gtk_expander_size_allocate): Make the event_window large
+       enough to cover the full height of the label_widget.  (#358351,
+       Scott Horowitz)
+
 2006-10-01  Tor Lillqvist  <tml@novell.com>
 
        * gtk/gtkfilesystemwin32.c: Same change as to gtkfilesystemunix.c.
index a1a321d3cf028985a48d04c9b8f105bd9f028e01..33333d5f12bf185417fb22cadd9ef76835a31152 100644 (file)
@@ -370,6 +370,7 @@ gtk_expander_realize (GtkWidget *widget)
   gint attributes_mask;
   gint border_width;
   GdkRectangle expander_rect;
+  gint label_height;
 
   priv = GTK_EXPANDER (widget)->priv;
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@@ -378,11 +379,21 @@ gtk_expander_realize (GtkWidget *widget)
 
   get_expander_bounds (GTK_EXPANDER (widget), &expander_rect);
   
+  if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+    {
+      GtkRequisition label_requisition;
+
+      gtk_widget_get_child_requisition (priv->label_widget, &label_requisition);
+      label_height = label_requisition.height;
+    }
+  else
+    label_height = 0;
+
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.x = widget->allocation.x + border_width;
-  attributes.y = expander_rect.y;
+  attributes.y = widget->allocation.y + border_width;
   attributes.width = MAX (widget->allocation.width - 2 * border_width, 1);
-  attributes.height = expander_rect.width;
+  attributes.height = MAX (expander_rect.height, label_height - 2 * border_width);
   attributes.wclass = GDK_INPUT_ONLY;
   attributes.event_mask = gtk_widget_get_events (widget)     |
                                GDK_BUTTON_PRESS_MASK        |
@@ -636,8 +647,10 @@ gtk_expander_size_allocate (GtkWidget     *widget,
       get_expander_bounds (expander, &rect);
 
       gdk_window_move_resize (priv->event_window,
-                             allocation->x + border_width, rect.y,
-                             MAX (allocation->width - 2 * border_width, 1), rect.width);
+                             allocation->x + border_width, 
+                             allocation->y + border_width, 
+                             MAX (allocation->width - 2 * border_width, 1), 
+                             MAX (rect.height, label_height - 2 * border_width));
     }
 
   if (child_visible)